#include "exttest.h"

namespace globals
{
    gcn::Gui* gui;
}

extern "C"
{
#include "sdl.hpp"
}

ZEND_GET_MODULE(exttest)

function_entry exttest_functions[] = {
       PHP_FE(helloexttest, NULL)
       {NULL, NULL, NULL}
};

zend_module_entry exttest_module_entry = {
	STANDARD_MODULE_HEADER,
	PHP_GUICHAN_EXTNAME,
	exttest_functions, /* Functions */
	PHP_MINIT(exttest), /* MINIT */
	PHP_MSHUTDOWN(exttest), /* MSHUTDOWN */
	PHP_RINIT(exttest), /* RINIT */
	PHP_RSHUTDOWN(exttest), /* RSHUTDOWN */
	PHP_MINFO(exttest), /* MINFO */
	PHP_GUICHAN_EXTVER,
	NULL, /*PHP_MODULE_GLOBALS(sdl),*/
	NULL, /* GINIT */
    NULL, /* GSHUTDOWN */
	NULL,
	STANDARD_MODULE_PROPERTIES_EX
};


/*******************************
 * PHP *_FUNCTIONS
 *******************************/
PHP_MINIT_FUNCTION(exttest) {
    return SUCCESS;
}
PHP_MSHUTDOWN_FUNCTION(exttest) {
	return SUCCESS;
}
PHP_RINIT_FUNCTION(exttest) {
	return SUCCESS;
}
PHP_RSHUTDOWN_FUNCTION(exttest) {
	return SUCCESS;
}
PHP_MINFO_FUNCTION(exttest)
{
    php_info_print_table_start();
    php_info_print_table_row(2, "Sojiqi Extension", "enabled");
    php_info_print_table_row(2, "Sojiqi Version", "1.0");
    php_info_print_table_end();
}

PHP_FUNCTION(helloexttest)

{
    zend_printf("Hello Word");
}